Skip to content

Application level handler support#116

Open
mephillips-durham wants to merge 5 commits intoc-jo:mainfrom
mephillips-durham:application-level-handler-support
Open

Application level handler support#116
mephillips-durham wants to merge 5 commits intoc-jo:mainfrom
mephillips-durham:application-level-handler-support

Conversation

@mephillips-durham
Copy link
Contributor

Branched from #114 but could be applied separately.

I may just be doing things wrong, but as the system is currently designed, if you want message handlers or wimp handlers to be called without being identified with a toolbox object, you have to include them in the main class of your application. That's because the dispatcher uses the id_block from Wimp_Poll to identify which toolbox object (or parent or ancestor) is referred to, and calls those handlers, falling back on handlers registered on the application itself. If you want a null poll handler, or a message handler, or any other handler that is not associated with the identifier of a toolbox object, these have to be declared in the application.

This change allows such handlers to be declared in other classes, yet be called at the application level alongside other application handlers. The code does this for any handler declared in a class which inherits neither from Application nor from Object. I am not sure if this is sufficient: it may be that mixins would pose difficulties. But it makes it easier to arrange the code of a bigger application in a logical way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant